package com.tjsinfo.tjsoa.worklog.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.common.PageController;
import com.tjsinfo.tjsoa.system.vo.User;
import com.tjsinfo.tjsoa.worklog.bo.IWorkLogDefineBo;
public class CheckDefalntWorkLogAction extends Action{
	private IWorkLogDefineBo  workLogDefineBo;
	
	public IWorkLogDefineBo getWorkLogDefineBo() {
		return workLogDefineBo;
	}

	public void setWorkLogDefineBo(IWorkLogDefineBo workLogDefineBo) {
		this.workLogDefineBo = workLogDefineBo;
	}

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		try {
			HttpSession session = request.getSession();
			User user = (User) session.getAttribute("user");
			List list = 	workLogDefineBo.selectDefineAndType(user.getUser_id());
			request.setAttribute("list", list);
			return mapping.findForward("ok");
			
		} catch (RuntimeException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
			return mapping.findForward("error");
		}
		
	}
}